<?php
	include_once('../admin/config.php');
	
	if (!empty($_POST))
	{
		$video = $_POST['video_id'];
		$video_params = getAllAboutVideo($video);
		
		$video_params['vimeo_id'] = getVimeoIDbyURL($video_params['link']);
		
		$tags_id = getAllVideoTags($video);
		
		foreach ($tags_id as $key => $id)
		{
			$tags[] = getAllAboutTag($id);
		}
		
		$video_params['tags'] = $tags;
		
		echo json_encode($video_params);
	}
	else
	{
		exit();
	}
?>